import request from "@/utils/request";
const prefixMine = "/v1.0/mine";
const SERVER_NAME = "SMART";

// 用户签到日历
export const appSigninDaysApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signin`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};
export const getBaseInfoApi = (params, config) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/baseInfo`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 获取用户详细信息与积分
export const getUserSettingOtherApi = (userId) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/setting/other/${encodeURIComponent(
      userId
    )}`,

    method: "get",
  };
  return request(cfg);
};

// 用户签到信息
export const appSigninInfoApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signin/info`,
    method: "get",
    params: {
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 获取签到规则
export const appSigninRuleApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/ruleExplain/one`,
    method: "get",
    params: {
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 签到接口
export const appSigninApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signin`,
    method: "post",
    data: params,
    params: {  server_name: SERVER_NAME },
  };
  return request(cfg);
};

// 签到盲盒抽奖
export const appSigninLotApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signin/lottery`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 补签盲盒抽奖
export const appSigninSupplementPrizeApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signin/supplementPrize`,
    method: "get",
    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 获取奖品列表
export const appSigninListApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signin/prizesDetail`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 新增保存地址
export const activitySaveAddressApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signin/address`,
    method: "post",
    data: params,

    params: {  server_name: SERVER_NAME },
  };
  return request(cfg);
};

// 地址列表
export const appUserAddListApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermall/addresses`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 更新保存地址
export const upadateSaveAddressApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermall/address/one`,
    method: "put",
    data: params,

    params: {  server_name: SERVER_NAME },
  };
  return request(cfg);
};

// 删除地址
export const deleteAddressApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermall/address/one`,
    method: "delete",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 地址详情
export const appUserAddDetailApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermall/address/one`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 奖品详情
export const appUserPrizeDetailApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signin/prizesDetailById`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 获取城市（地址）
export const getCitysApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/mallProduct/code`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 补签卡列表
export const signInSupplementPageApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signInSupplement/page`,
    method: "post",
    data: params,

    params: {  server_name: SERVER_NAME },
  };
  return request(cfg);
};

// 用户补签卡数量
export const signInSupplementCountApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signInSupplement/count`,
    method: "post",
    data: params,

    params: {  server_name: SERVER_NAME },
  };
  return request(cfg);
};

// 补签
export const signInSupplementContinuityApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signInSupplement/continuity`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 使用补签卡
export const signInSupplementConsumeApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signInSupplement/consume`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 补签卡详情
export const signInSupplementDetailApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signInSupplement/detail`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

// 兑换补签卡
export const signInSupplementGainApi = (params = {}) => {
  const cfg = {
    url: `${prefixMine}/cfmotoservermine/signInSupplement/gain`,
    method: "get",

    params: {
      
      ...(params || {}),
      server_name: SERVER_NAME,
    },
  };
  return request(cfg);
};

export default {};
